package cn.cqie.attendance.manager.util;

import cn.cqie.attendance.manager.pojo.AdminAttendancePunch;

import java.util.List;
import java.util.regex.Pattern;

public class ValidateRecordUtil {

    public static boolean validate(List<AdminAttendancePunch> punchList) {
        int i = 0;
        for (; i < punchList.size(); i++) {
            AdminAttendancePunch punch = punchList.get(i);
            String stuNumber = punch.getStuNumber();
            if (stuNumber.length() == 9) {
                Pattern pattern = Pattern.compile("[0-9]*");
                if (pattern.matcher(stuNumber).matches()) {
                    continue;
                }
                break;
            }
        }
        return i == punchList.size();
    }
}
